home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club (Business) 1998 January / Software of the Month Club - Business Shareware (Volume 245) (January 1998).iso / dos / biz / train / pack1.prg / TEMP2 / CONVERT.SC < prev    next >
Text File  |  1992-05-18  |  4KB  |  160 lines

  1. PROC init_screen()
  2.  
  3. ;    *****************************************************************
  4. ;    Iinitializes the screen to look somewhat like DataEase
  5. ;    *****************************************************************
  6.  
  7.  
  8.     ; Clear the first 2 lines in the correct colors
  9.     STYLE ATTRIBUTE 14
  10.     @ 0,0
  11.     ?? SPACES(80)
  12.  
  13.     STYLE ATTRIBUTE 32
  14.     @ 1,0
  15.     ?? SPACES(80)
  16.     CLEAR EOL
  17.  
  18.     ;clear the rest of the screen
  19.  
  20.     STYLE ATTRIBUTE 14
  21.     FOR x FROM 2 to 24
  22.         @ x,0
  23.         ?? SPACES(80)
  24.     ENDFOR
  25.  
  26.     @ 0,0
  27.     ?? "DataEase Convert 1.1"
  28.  
  29.     ; Function key line
  30.     @ 24,0
  31.     ?? "ESC:"
  32.     STYLE ATTRIBUTE 79
  33.     ?? "EXIT"
  34.     
  35.     STYLE ATTRIBUTE 32
  36.     @ 1,0
  37.     ?? "Exporting Data From Paradox to DataEase..."
  38.  
  39.     ;draw a box in the middle of the screen
  40.     STYLE ATTRIBUTE 14
  41.     @ 7,10
  42.     ?? "╓──────────────────────────────────────────────────────────────╖"
  43.  
  44.     FOR x FROM 8 to 15
  45.         @ x,10
  46.         ?? "║                                                              ║"
  47.     ENDFOR
  48.  
  49.     @ 16,10
  50.     ?? "╙──────────────────────────────────────────────────────────────╜"
  51.  
  52.  
  53.  
  54. ENDPROC
  55.  
  56. PROC get_out()
  57.  
  58.     BEEP
  59.     STYLE ATTRIBUTE 12
  60.     @ 14,20
  61.     ?? "ESC Pressed. Press Any Key to Exit..."
  62.  
  63.     x = GETCHAR()    
  64.  
  65.     EXIT            ; Terminates Paradox and returns to DataEase
  66.  
  67. ENDPROC
  68.  
  69.  
  70.  
  71. PROC handle_errors()
  72.  
  73. ;    *****************************************************************
  74. ;
  75. ;    This procedure handles any errors that may show up
  76. ;
  77. ;    *****************************************************************
  78.  
  79.     PRIVATE Errorproc    ; Prevent errors within the error handler
  80.     
  81.     BEEP
  82.     @ 12,20
  83.     ?? ERRORMESSAGE()    ;print the error that occured
  84.  
  85.     STYLE ATTRIBUTE 12
  86.     @ 14,20
  87.     ?? "An Error has occured. Press Any Key to Exit..."
  88.  
  89.     x = GETCHAR()    
  90.  
  91.     EXIT            ; Terminates Paradox on any error
  92.  
  93. ENDPROC
  94.  
  95. PROC convert_file(form_name,data_file)
  96.  
  97. ;    *****************************************************************
  98. ;
  99. ;    This is the procedure that actually converts the
  100. ;    Paradox files to ASCII format for import
  101. ;    into DataEase
  102. ;
  103. ;    *****************************************************************
  104.     
  105.     STYLE ATTRIBUTE 14
  106.     @ 10,20 
  107.     ?? "                                        "
  108.     @ 10,20
  109.     ?? "Exporting "+form_name+" to DataEase..."
  110.     {Tools}{ExportImport}{Export}{Ascii}{Delimited}
  111.     SELECT form_name    ;SELECT is necessary to substitute a variable name
  112.     SELECT data_file    ;For a text entry
  113.  
  114.     ; check for any keyboard activity
  115.     WHILE CHARWAITING()
  116.         x = GETCHAR()
  117.         IF x = 27 THEN        ;ESC pressed
  118.             get_out()
  119.         ENDIF
  120.     ENDWHILE
  121.  
  122. ENDPROC
  123.  
  124. ;    *****************************************************************
  125. ;    This line sets the error handling procedure
  126. ;    You may substitute your own error handler
  127. ;    *****************************************************************
  128.  
  129. Errorproc = "handle_errors"    ; Error handling PROC
  130.  
  131. init_screen()            ; initializes screen colors, etc
  132.  
  133. ;    *****************************************************************
  134. ;    This line sets the default data file directory
  135. ;    DO NOT change it!!
  136. ;    *****************************************************************
  137.  
  138. ##1 {Tools} {More} {Directory} {%s} {OK}
  139.  
  140. ;    *****************************************************************
  141. ;
  142. ;    You may place any paradox commands you want above
  143. ;    or below the section labeled 'DATAEASE.CONVERT'
  144. ;    Modifying any of the lines within this routine can cause
  145. ;    CONVERT to work incorrectly
  146.  
  147. ;    *****************************************************************
  148. ;    *                    DATAEASE.CONVERT                           *
  149. ;    *                                *
  150. ;    *****************************************************************
  151.  
  152. ##2 convert_file("%s","%s")    
  153. ##3 EXIT            ; Terminates Paradox
  154.  
  155. ;    *****************************************************************
  156. ;    *                      END.CONVERT                              *
  157. ;    *                                *
  158. ;    *****************************************************************
  159.  
  160.